import axios from '@/functions/request';
function getList(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doGetList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function edit(prams){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doAddRoleFunction",prams).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function getUserListByRoleId(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuser/doGetListWithRoleId",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function getUserListByOrganId(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuser/doGetList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function addRoleUser(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doAddRoleUser",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function delRoleUser(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysrole/doDelRoleUser",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

// 


export {
    getList,
    edit,
    getUserListByRoleId,
    getUserListByOrganId,
    addRoleUser,
    delRoleUser
}